package com.aidex.tina.domain;

import javax.validation.Valid;
import java.math.BigDecimal;
import javax.validation.constraints.NotBlank;
import lombok.Data;
import com.aidex.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aidex.common.utils.log.annotation.FieldRemark;
import com.aidex.common.utils.log.annotation.LogField;
import com.aidex.common.annotation.Excel;

/**
 * 采购单条目对象 tina_bill_item
 * @author Stanfine
 * @email shanliang@outlook.com
 * @date 2022-06-08
 */
@Data
public class BillItem extends BaseEntity<BillItem>
{
    private static final long serialVersionUID = 1L;

    /** 采购单主键 */
    @Excel(name = "采购单主键")
    private String billId;

    /** 物料编号 */
    @Excel(name = "物料编号")
    @NotBlank(message = "物料编号不允许为空")
    @LogField
    @FieldRemark(name = "物料编号",field = "materialId")
    private String materialId;

    /** 价格 */
    @Excel(name = "价格")
    @LogField
    @FieldRemark(name = "价格",field = "price")
    private BigDecimal price;

    /** 数量 */
    @Excel(name = "数量")
    @LogField
    @FieldRemark(name = "数量",field = "count")
    private Long count;

    /** 条目金额 */
    @Excel(name = "条目金额")
    private BigDecimal totalPrice;

    public void setBillId(String billId) 
    {
        this.billId = billId;
    }

    public String getBillId() 
    {
        return billId;
    }

    public void setMaterialId(String materialId) 
    {
        this.materialId = materialId;
    }

    public String getMaterialId() 
    {
        return materialId;
    }

    public void setPrice(BigDecimal price) 
    {
        this.price = price;
    }

    public BigDecimal getPrice() 
    {
        return price;
    }

    public void setCount(Long count) 
    {
        this.count = count;
    }

    public Long getCount() 
    {
        return count;
    }

    public void setTotalPrice(BigDecimal totalPrice) 
    {
        this.totalPrice = totalPrice;
    }

    public BigDecimal getTotalPrice() 
    {
        return totalPrice;
    }


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("billId", getBillId())
            .append("materialId", getMaterialId())
            .append("price", getPrice())
            .append("count", getCount())
            .append("totalPrice", getTotalPrice())
            .append("remark", getRemark())
            .append("id", getId())
            .append("createBy", getCreateBy())
            .append("createDept", getCreateDept())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("updateIp", getUpdateIp())
            .append("version", getVersion())
            .append("delFlag", getDelFlag())
            .toString();
    }
}
